package com.jiafa.wjxt.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jiafa.wjxt.entity.TUserProjectItem;
import com.jiafa.wjxt.mapper.TUserProjectItemMapper;
import com.jiafa.wjxt.service.TUserProjectItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jiafa
 * @since 2021-05-31
 */
@Service
public class TUserProjectItemServiceImpl extends ServiceImpl<TUserProjectItemMapper, TUserProjectItem> implements TUserProjectItemService {

    @Autowired
    TUserProjectItemMapper tUserProjectItemMapper;

    @Override
    public List<TUserProjectItem> listByProjectKey(String projectKey) {
        QueryWrapper<TUserProjectItem> wrapper = new QueryWrapper<>();
        System.out.println(projectKey);
        if(projectKey != null){
            wrapper.eq("project_key",projectKey);
        }
        List<TUserProjectItem> tUserProjectItems = tUserProjectItemMapper.selectList(wrapper);
        return tUserProjectItems;
    }
}
